#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableRaidRunMapBuffDao:DaoBase<TableRaidRunMapBuff>
    {
        public override string GetFileName()
        {
            return "TableRaidRunMapBuff.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableRaidRunMapBuff>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableRaidRunMapBuff model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.raidSceneBuffId)) UnityEngine.Debug.LogError("数据表id重复:TableRaidRunMapBuff->id: " + model.raidSceneBuffId);
            #endif
            cachePrimaryInt[model.raidSceneBuffId] = model;
        }
        protected override TableRaidRunMapBuff ParseRowData(string[] rowData)
        {
            TableRaidRunMapBuff data = new TableRaidRunMapBuff();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.raidSceneBuffId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.canRemove = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.duration = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.interval = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.applyForever = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.buffApplyType = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.buffApplyParams = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.buffStateEffectId = rowData[7];
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.buffApplyCameraEffect = rowData[8];
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.buffApplyAnim = rowData[9];
            }
            return data;
        }
    }
}
